<div class="row">

    <ul class="thumbnails">

        <?php
            $shor_posts = $posts;
            shuffle($shor_posts);
            $i = 0;
            foreach ($shor_posts as $key => $post) :
                if (isset($post['photo_name'])):
                    if ($i == 2)
                        break;

                    $i++;

                    $href = lang_url('top_offer/' . $post['url_name'] . '-' . $post['ID']);
                    ?>


                    <li class="span4">
                        <a class="thumbnail" href="<?= $href ?>">

                            <img src="<?= thumb_filename($post['photo_name'], 300, 178, CMS_GALLERY, $post['photo_path']) ?>" alt="<?= $post['title']; ?>" class="img-rounded" />

                            <div class="black">

                                <h3><?= $post['title']; ?></h3>

                            </div>

                        </a>
                    </li>

                    <?php
                endif;
            endforeach;
        ?> 

    </ul>

</div>